package lesson01;

import java.io.File;

public class Demo_108 {


    public static void main(String[] args) {
        File sourceFile = new File("D:/temp/hello.txt");
        File destFile = new File("D:/temp/world.txt");

        System.out.println("重命名："+sourceFile.renameTo(destFile));
    }








    public static void main1(String[] args) {
        File sourceFile = new File("D:/temp/hello.txt");
        File destFile = new File("D:/temp/world.txt");
        System.out.println("重命名是否成功："+sourceFile.renameTo(destFile));

    }
}
